package vip.mall.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Asus
 * @Date 2025/2/10 9:23
 * @Descripition 通用实体类，减少代码重复度
 */
@Schema(description = "公共实体类")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class CommonEntity implements Serializable {
    @Schema(description = "主键")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @Schema(description = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Schema(description = "是否删除")
    @TableLogic
    @TableField(value = "is_delete", fill = FieldFill.INSERT)
    private String isDelete;
}
